﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 窗口继承
{
    public partial class Form2 : Form1
    {
        public Form2()
        {
            InitializeComponent();
            label1.Text = "调用了窗口1的显示";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (sender is Form2)
                MessageBox.Show("存在关联");
            else
                MessageBox.Show("不存在关联");

        }
    }
}
